
/**
 * Write a description of class EksJavaDoc here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class EksJavaDoc
{
    // instance variables - replace the example below with your own
    private int x;

    /**
     * Constructor for objects of class EksJavaDoc
     */
    public EksJavaDoc()
    {
        // initialise instance variables
        x = 0;
    }

    /**
     * An example of a method - replace this comment with your own
     * 
     * @param  y   a sample parameter for a method
     * @return     the sum of x and y 
     */
    public int sampleMethod(int y)
    {
        // put your code here
        return x + y;
    }
    
     /**
     * gets DVD with title
     * 
     * @param title title of DVD
     * 
     * @return DVD with title
     */
    public DVD getDVD(String title)
    {
        return dvdContainer.getDVD(title);
    }
    
    
    /**
     * delete a DVD with title input
     * 
     * @param String title title of person to find
     * 
     * @return none
     */
    public void deleteDVD(String title)
    {
        DVD dvd = dvdContainer.getDVD(title);
        dvdContainer.deleteDvd(dvd);
    }
    
    /**
     * delete a DVD copy with title and serial
     * 
     * @param title title of DVD
     * @param serial serialnumber og DVDCopy
     * 
     * @return none
     */
    public void deleteDVDCopy(String title, int serial)
    {
        DVD dvd = dvdContainer.getDVD(title);
        DVDCopy dvdCopy = dvd.getDVDCopy(serial);
        dvd.deleteDVDCopy(dvdCopy);
    }
    
    /**
     * adds DVDCopy to DVD
     * 
     * @param title title of DVD which to add a copy 
     * @param newSerialNumber serialNumber
     * @param newObtainedDate obtainedDate of DVDCopy
     * @param newObtainedPrice ObtainedPrice of DVDCopy
     */
    public void addDVDCopy(String title, int newSerialNumber, String newObtainedDate, int newObtainedPrice)
    {
        DVD dvdToAddCopyTo = dvdContainer.getDVD(title); // get dvd which copy belongs to
        DVDCopy newCopy = new DVDCopy(newSerialNumber, newObtainedDate, newObtainedPrice); // create copy
        dvdToAddCopyTo.addDVDCopy(newCopy); // add copy to dvd
    }
}
